<?php
class PointsController extends Controller{

	public function index(){
		$this->getSmarty();
		$this->loadSubjects();
        require_once COMMON . DS  . 'Constant.class.php';
    //     $this->$smaryt->assign ( 'pagesets', $this->headerDatas() );
        $this->smarty->assign ( 'pagesets', Constant::indexHeader() );
		$this->smarty->display("user_center/index.tpl");
	}
	
	function loadSubjects(){
		require_once SERVICE . DS . 'CommonDataService.class.php';
		$service = new CommonDataService ( $this->getDB () );
		$sql = " SELECT   name ,url FROM  SUBJECT t ORDER BY t.index LIMIT 0, 6";
		$results = $service->getResults ( $sql );
		foreach ($results as $k => $val) {
			$val->url = WEBSITE_URL.$val->url;
       	}
       $this->smarty->assign ( 'subjects', $results);
	}

}